import MsuiAxios from './msui-utils/msui-axios'
import MsuiUtils from './msui-utils/msui-utils'
import MsuiSubcribe from './msui-utils/msui-subcribe'
import MsuiDataGridModel from './msui-model/msui-datagrid-model'
import MsuiFormModel from './msui-model/msui-form-model'
import MsuiDialog from './msui-base-component/msui-dialog'
import MsuiInput from './msui-base-component/msui-input'
import MsuiSelectBox from './msui-base-component/msui-select'
import MsuiUpload from './msui-base-component/msui-upload'
import MsuiPagination from './msui-base-component/msui-pagination'
import MsuiDatagrid from './msui-base-component/msui-datagrid'
import Msuiform from './msui-base-component/msui-form'
import MsuiTimePicker from './msui-base-component/msui-time-picker'
import modelListCore from './msui-base-component/modelListCore'
import MsuiMessage from './msui-utils/msui-messagse'
import MsuiDrawer from './msui-base-component/msui-drawer'
import MsuiCharts from './msui-base-component/msuiCharts'
import MsuiRadio from './msui-base-component/msui-radio'
import MsuiSpan from './msui-base-component/msui-span'
import MsuiTree from './msui-base-component/msui-tree'
import MsuiSwitch from './msui-base-component/msui-switch'
import MsuiSelectTree from './msui-base-component/msui-select-tree'
import msuiSet from './msui-model/msui-set'

const map = {
  MsuiAxios,
  MsuiUtils,
  MsuiDataGridModel,
  MsuiFormModel,
  msuiSet,
  MsuiSubcribe,
  MsuiMessage
}

const components = [
  MsuiDialog,
  MsuiInput,
  MsuiSelectBox,
  MsuiPagination,
  MsuiTimePicker,
  MsuiDatagrid,
  Msuiform,
  MsuiUpload,
  modelListCore,
  MsuiDrawer,
  MsuiCharts,
  MsuiRadio,
  MsuiSpan,
  MsuiTree,
  MsuiSwitch,
  MsuiSelectTree
]

export default class MsuiPlugins {
  static install(Vue) {
    for (let key in map) {
      Vue.prototype[key] = map[key]
      components.forEach((item) => {
        Vue.component(item.name, item)
      })
    }
  }
}
